/**
 *Copyright (c) 2024 watereyes
 * safetymanagement is licensed under Mulan PubL v2.
 * You can use this software according to the terms and conditions of the Mulan
 * PubL v2.
 * You may obtain a copy of Mulan PubL v2 at:
 *          http://license.coscl.org.cn/MulanPubL-2.0
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
 * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
 * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PubL v2 for more details.
 */
package com.koron.workflow.bean;



import org.swan.bean.MessageBean;

public class MessageEntity<T> extends MessageBean<T> {
    /**
     * 当前页
     */
    private Integer page;
    /**
     * 每页条数
     */
    private Integer pagecount;
    /**
     * 列表数据总条数
     */
    private Integer totalCount;


    /**
     * 返回成功消息体
     * @return
     */
    public static <T> MessageEntity<T> success(){
        MessageEntity<T> bean = new MessageEntity<T>();
        /*bean.setCode(Constant.MESSAGE_INT_SUCCESS);
        bean.setDescription("success");*/
        return bean;
    }
    /**
     * 返回成功消息体
     * @param data 数据
     * @return
     */
    public static <T> MessageEntity<T> success(T data){
        MessageEntity<T> bean = new MessageEntity<T>();
        /*bean.setCode(Constant.MESSAGE_INT_SUCCESS);
        bean.setDescription("success");
        bean.setData(data);*/
        return bean;
    }
    /**
     * 返回成功消息体
     * @param data 数据
     * @param page 起始页
     * @param pagecount 每页条数
     * @return
     */
    public static <T> MessageEntity<T> success(T data,Integer page,Integer pagecount){
        MessageEntity<T> bean = new MessageEntity<T>();
    /*    bean.setCode(Constant.MESSAGE_INT_SUCCESS);
        bean.setDescription("success");
        bean.setPage(page);
        bean.setPagecount(pagecount);
        bean.setData(data);*/
        return bean;
    }

    public Integer getPage() {
        return page;
    }
    public void setPage(Integer page) {
        this.page = page;
    }
    public Integer getPagecount() {
        return pagecount;
    }
    public void setPagecount(Integer pagecount) {
        this.pagecount = pagecount;
    }
    public Integer getTotalCount() {
        return totalCount;
    }
    public void setTotalCount(Integer totalCount) {
        this.totalCount = totalCount;
    }

}